package com.alison;

import com.alison.config.ConfigProperties;
import com.alison.config.NestConfigProperties;
import com.alison.config.PropertyConversion;
import com.alison.pojo.Item;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

import javax.annotation.Resource;

/**
 * @author wayne
 * @version ConfigPropApp,  2020/2/1 11:05 上午
 */
@SpringBootApplication
//@EnableConfigurationProperties(ConfigProperties.class)
//@ConfigurationPropertiesScan("com.alison.config")
public class ConfigPropApp  implements ApplicationRunner {



    @Resource
    private Item item;

    @Resource
    private PropertyConversion propertyConversion;
    public static void main(String[] args) {
        SpringApplication.run(ConfigPropApp.class,args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println(item);
        System.out.println(propertyConversion);
    }
}
